package com.io;

import org.apache.commons.io.IOUtils;

import java.io.*;

public class BufferedReadTest {
    public static void main(String[] args) {
        InputStream is = null;
        InputStreamReader isr = null;
        BufferedReader br = null;

        try {
            is = new FileInputStream("/Users/edy/Desktop/file1/1.txt");
            isr = new InputStreamReader(is,"UTF-8");
            br = new BufferedReader(isr);

            String str;
            while ((str = br.readLine()) != null) {
                System.out.println(str);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUtils.closeQuietly(br);
            IOUtils.closeQuietly(isr);
            IOUtils.closeQuietly(is);
        }
    }
}
